Skip to content

feat(terminal): keep terminal mounted with exit banner on session death (port upstream #58) - #42

Merged
JeanBaptisteRenard merged 1 commit into
mainfrom
feat/port-upstream-58-exit-banner
Jun 9, 2026
Merged

feat(terminal): keep terminal mounted with exit banner on session death (port upstream #58)#42
JeanBaptisteRenard merged 1 commit into
mainfrom
feat/port-upstream-58-exit-banner

Conversation

@JeanBaptisteRenard

Copy link
Copy Markdown
Collaborator

Port of upstream doctly/switchboard#58 by @HaydnG.

Problem

The fork tore down the terminal silently the moment a session process exited (onProcessExiteddestroySession). A fast-failing pre-launch command (devbox/shell error) destroyed the terminal before the user could read the stderr.

Fix

  • Claude sessions stay mounted on exit and print a banner: ── session exited (code N) — re-click to relaunch, or click another to dismiss ── (dim on code 0, yellow otherwise). Cleanup deferred to the existing re-click/reconciliation path.
  • Plain terminal sessions remain ephemeral — destroyed immediately on exit as before.

Test

test/exit-banner.test.js (node:test). app.js is a load-time-monolithic renderer file, so the test exercises the ported onProcessExited logic via a mock harness mirroring the real state shapes (documented in the file) rather than vm.runInContext — same approach trade-off noted in the fork's other renderer tests.

Credit: @HaydnG / doctly#58.

Port of upstream doctly#58 (author @HaydnG).

The fork destroyed the terminal silently when a session process exited,
which also swallowed stderr from a fast-failing pre-launch command. Now
Claude sessions stay mounted and print an exit banner (dim on code 0,
yellow otherwise) so the user can read what happened and relaunch by
re-clicking. Plain terminal sessions remain ephemeral (destroyed on exit).
@JeanBaptisteRenard
JeanBaptisteRenard merged commit af34f5e into main Jun 9, 2026
7 checks passed
@JeanBaptisteRenard
JeanBaptisteRenard deleted the feat/port-upstream-58-exit-banner branch June 9, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant